package com.rzjm.exercise.common.utils;

import java.util.Collection;
import java.util.Map;

public abstract class CollectionUtils {
	/**
	 * 判断list、map是否为空
	 */
	public static boolean isEmpty(Object obj) {
		if (obj == null) {
			return true;
		}
		
		if (Map.class.isAssignableFrom(obj.getClass())) {
			return ((Map<?, ?>) obj).isEmpty(); 
		} else if (Collection.class.isAssignableFrom(obj.getClass())) {
			return ((Collection<?>) obj).isEmpty();
		}
		
		return false; 
	}
}
